///////////////////////////////////////////////////////////////////////////////////////////////////
// Illusion Ray Development Kit (IDK)           Copyright (c) 2010 ( dimitriy.martynenko@gmail.com )
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2010-05-22
// Updated : ...
// Licence : NEW BSD
// Info	   : "SCL" Safe Code Lib (for C++ unmanaged)
///////////////////////////////////////////////////////////////////////////////////////////////////
/*-------------------------------------------------------------------------
| TSet:
| ------------
| 
---------------------------------------------------------------------------*/
static const unsigned long int TSetBitMask[32] =
{
	0x80000000,	0x40000000,	0x20000000,	0x10000000,
	0x8000000,	0x4000000,	0x2000000,	0x1000000,
	0x800000,	0x400000,	0x200000,	0x100000,
	0x80000,	0x40000,	0x20000,	0x10000,
	0x8000,		0x4000,		0x2000,		0x1000,
	0x800,		0x400,		0x200,		0x100,
	0x80,		0x40,		0x20,		0x10,
	0x8,		0x4,		0x2,		0x1 
};
template<typename TEnum, typename T = unsigned long int>
class Set
{
protected:
public:
	typedef T Type;
	Set(void): mMask(0x0)					{}
	Set(TEnum key) : mMask(0x0)				{ Include(key); }
	void Include(TEnum key)					{ mMask |= TSetBitMask[key]; }
	void Exclude(TEnum key)					{ mMask &= ~TSetBitMask[key]; }
	bool In(TEnum key) const				{ return(mMask & TSetBitMask[key]) == TSetBitMask[key]; }
	T GetMask(void) const					{ return mMask; }
	void SetMask(T mask)					{ mMask = mask; }
private:
	T mMask;
};